import type * as echarts from 'echarts/core';
import type { ToolboxComponentOption, LegendComponentOption } from 'echarts/components';
import type { PieSeriesOption } from 'echarts/charts';

type EChartsOption = echarts.ComposeOption<
  ToolboxComponentOption | LegendComponentOption | PieSeriesOption
>;

const option: EChartsOption = {
  legend: {
    top: 'bottom',
  },
  toolbox: {
    feature: {
      dataView: { show: true, readOnly: false },
    },
  },
  series: [
    {
      name: 'Nightingale Chart',
      type: 'pie',
      radius: '50%',
      center: ['50%', '50%'],
      roseType: 'radius',
      itemStyle: {
        borderRadius: 5,
      },
      data: [
        { value: 20, name: '1' },
        { value: 18, name: '2' },
        { value: 12, name: '3' },
        { value: 20, name: '4' },
        { value: 22, name: '5' },
        { value: 16, name: '6' },
        { value: 23, name: '7' },
        { value: 18, name: '8' },
      ],
    },
  ],
};

export default option;
